﻿
    $(windowResize)

    $(window).resize(function ()
    {
        windowResize();
    });

   
    function windowResize()
    {
        var height = $(window).height();

        if (height > 800)
        {
            $("body").css("padding-top", "4%");

        } else if (height > 650)
        {
            $("body").css("padding-top", "2%");
        } else
        {
            $("body").css("padding-top", "20px");
        }

        $("body").css("-moz-background-size", "100% " + ($(document).height()) + "px ");
        $("body").css("background-size", "100% " + ($(document).height()) + "px ");


        var width = $(window).width();
        if (width <= 1220)
        {
            LocdResize(1);
            $("#row").css("margin-left", "20px");
            $("#row").css("position", "static");
            $("#container_r").css("width", "850px");
            $(".rowleftico").css("padding-left", "20px");
            $(".rowleftico").css("padding-right", "30px");
            rowHide();
        } else
        {
            LocdResize(2);
            $("#container_r").css("width", "850px");
            $("#container").css("width", "1220px");
            RunFlip()
        }
    }

    var _IsWindowResize = -1;

    //设置当前显示模式 小分辨率or大分辨率
    function LocdResize(index)
    {
        if (_IsWindowResize == -1)
        {
            _IsWindowResize = index;
        } else if (_IsWindowResize != index)
        {
            window.location = window.location;
        }
    }

    function rowShow()
    {
        $("#rowleftico").unbind();
        $("#row").show();
        $('#row').animate({ width: '280px' }, 1000, null, function ()
        {
            $("#rowleftico").bind("click", function () { rowHide() });
        });
        $("body").css("overflow-x", "auto");
        $("#container").css("width", "1300px");
        RunFlip();
    }

    var _IsRowHide = false;

    function rowHide()
    {
        if (_IsRowHide == false)
        {
            _IsRowHide = true;
            $("#rowleftico").unbind();
            $('#row').css("width", "280px");
            $("#container").css("width", "1300px");

            $('#row').animate({ width: '0px' }, 1000, null, function ()
            {
                $("#container").css("width", "1000px");
                $(document).css("width", "1000px");
                $("#row").hide();
                $("#rowleftico").bind("click", function () { rowShow() });
                _IsRowHide = false;
            });
            $("body").css("overflow-x", "hidden");
        }
    }

    $(window).scroll(function ()
    {
        if ($(document).scrollLeft() > 1)
        {
            rowHide();
            $(document).scrollLeft(0);
        }
    });



